const { app, BrowserWindow, ipcMain } = require("electron/main")
const path = require("node:path")
console.log("数据 __dirname", __dirname)
const createWindow = () => {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, "../preload/index.js"),
    },
  })
  win.loadFile(path.join(__dirname, "../renderer/index.html"))
}
app.whenReady().then(() => {
  ipcMain.handle("ping", () => "pong")
  createWindow()
})
